package com.example.museum.controller;


import com.example.museum.common.Result;
import com.example.museum.service.DashboardStatisticsService;
import com.example.museum.vo.DashboardStatisticsVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据统计
 */

@RestController
@RequestMapping("statistics")
@Slf4j
public class DashboardStatisticsController {

    @Autowired
    private DashboardStatisticsService dashboardStatisticsService;

    /**
     *  获取数据
     * @return
     */

    @GetMapping("dashboard")
    public Result<DashboardStatisticsVo> getDashboard() {
        DashboardStatisticsVo dashboardStatisticsVo =  dashboardStatisticsService.getData();
        return Result.success(dashboardStatisticsVo);
    }

}
